<template>
  <div class="content-block block---1" style="background: none;">
    <div class="info-content">
      <div class="flex justify-between overview">
        <div
          class="overview-item" v-for="(item, index) in info"
          :key="index" :style="{backgroundColor: themeColor}"
        >
          <h2 class="item-label">{{ item.label }}</h2>
          <div class="item-main">
            <span class="item-number">{{ item.count }}</span>
            <span class="item-unit">{{ item.unit }}</span>
          </div>
          <p class="item-content">
            {{ item.content }}
          </p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'grid-item-one',
  data () {
    return {
      info: [
        {
          label: '工业总产值',
          count: '-',
          unit: '亿元',
          content: '同比：- %',
          icon: 'topsales'
        },
        {
          label: '万元产值能耗',
          count: '-',
          unit: '千克标准煤/万元',
          content: '同比：- %',
          icon: 'topsales'
        },
        {
          label: '万元产值电耗',
          count: '-',
          unit: '千瓦时/万元',
          content: '同比：- %',
          icon: 'tongxunlu'
        },
      ]
    }
  },
  computed: {
    themeColor () {
      return this.$store.state.user.theme
    }
  }
}
</script>

<style lang="scss" scoped>
@import "@/assets/style/variable.scss";

.overview-item {
  flex: 1;
  border-radius: 4px;
  padding: 20px;
  color: white;
  position: relative;
  overflow: hidden;

  & + .overview-item {
    margin-left: $gutter;
  }
}

.item-label {
  font-size: 18px;
  font-weight: 500;
  margin-top: 0;
}

.item-number {
  font-size: 20px;
  color: orange;
  margin-right: 5px;
}

.item-icon {
  position: absolute;
  right: 40px;
  bottom: 10px;
  font-size: 60px;
  color: white;
  opacity: .8;
}
</style>
